package br.com.nautical.persistence.model.servicos;

import java.util.List;

import javax.persistence.EntityManager;
import javax.persistence.Query;

import br.com.nautical.persistence.model.Cliente;

public class ClienteServicos {

	private EntityManager manager;

	public ClienteServicos (EntityManager manager){
		this.manager = manager;
	}

	public void gravar(Cliente cliente){
		this.manager.persist(cliente);
	}

	public void remover(Cliente cliente){
		this.manager.find(Cliente.class, cliente);
		this.manager.remove(cliente);
	}
	
	public void alterar(Cliente cliente){
		
	}
	
	public List<Cliente> buscaTodosClientes(){
		Query query = this.manager.createQuery("select e from Cliente e");
		
		return query.getResultList();
	}

}
